#FROM csbase.registry.cmbchina.cn/paas/cmb-nginx-1.22:c86-kylin10-v1
#
#COPY ./dist /opt/public
#COPY ./deploy/nginx.conf /opt/nginx/conf/nginx.conf
#EXPOSE 4200
#CMD ["/opt/nginx/sbin/nginx","-p","/opt/nginx","-c","/opt/nginx/conf/nginx.conf"]
#RUN rm -rf /opt/public/nginx.conf

# 拷贝所有源代码到工作目录
COPY . /opt/deployments/

USER root
#RUN yum update -y  && yum install libxshmfence nss gtk3 atk at-spi2-atk cups-libs libxkbcommon-x11-devel libXcomposite libXdamage.x86_64 mesa-libgbm pango libxkbcommon libXrandr alsa-lib -y

# add node support
RUN tar -vxf /opt/deployments/docker/node-v16.19.0-linux-x64.tar.gz -C /opt/deployments/docker

ENV PATH /opt/deployments/docker/node-v16.19.0-linux-x64/bin/:$PATH
ENV HOME /opt

WORKDIR /opt/deployments

RUN npm install -g npm@9.8.0 --registry http://central.jaf.cmbchina.cn/artifactory/api/npm/group-npm && npm install

#RUN curl -o /opt/deployments/packages/file-server/chrome-linux.zip http://central.jaf.cmbchina.cn/artifactory/taobao-mirrors/chromium-browser-snapshots/Linux_x64/884014/chrome-linux.zip && cd /opt/deployments/packages/file-server && unzip chrome-linux.zip
# 暴露8080端口
EXPOSE 8080

CMD ["npm", "run", "start2"]
